<%@page import="com.shsh.safemanage.model.Department2"%>
<%@page import="com.shsh.safemanage.model.PostcheckStandard"%>
<%@page import="com.shsh.safemanage.model.PostcheckContent"%>
<%@page import="com.shsh.safemanage.model.PostcheckPattern"%>
<%@page import="com.shsh.safemanage.model.PostCheck"%>
<%@page import="com.shsh.safemanage.action.WriteProblemAction"%>
<%@page import="com.shsh.safemanage.dao.TitlePostManageGroupDao"%>
<%@page import="com.shsh.safemanage.dao.PostCheckDao"%>
<%@page import="com.shsh.safemanage.dao.ProblemDao"%>
<%@page import="com.shsh.safemanage.util.RequestUtil"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%
{
	Long problemID = RequestUtil.getParameter(request, Constants.REQUEST_PARAMETER_ID, 0l);
	Long transferID = RequestUtil.getParameter(request, Constants.REQUEST_PARAMETER_TRANSFER_ID, 0l);
	String fromPage = request.getParameter(Constants.REQUEST_PARAMETER_FROM_PAGE);

	DepartmentDao departmentDao = DaoCreator.createDepartmentDao();
	ProblemDao problemDao = DaoCreator.createProblemDao();
	PostCheckDao postcheckDao = DaoCreator.createPostCheckDao();
	TitlePostManageGroupDao titlePostManageGroupDao = DaoCreator.createTitlePostManageGroupDao();
	WriteProblemAction writeProblemAction = ActionCreator.createWriteProblemAction();
	UserAction userAction = ActionCreator.createUserAction();

	Problem problem = problemDao.getProblemByID(problemID);

	PostCheck postcheck = null;
	PostcheckPattern postcheckPattern = null; 
	PostcheckContent postcheckContent = null; 
	PostcheckStandard postcheckStandard = null; 

	if(problem.getProblemType() == Constants.PROBLEM_TYPE_POSTCHECK) {
		postcheck = postcheckDao.getPostCheck(problem.getPostcheckID());
		postcheckPattern = postcheckDao.getPostcheckPatternByID(problem.getPostcheckPatternID());
		postcheckContent =  postcheckDao.getPostcheckContentByID(problem.getPostcheckContentID());
		postcheckStandard = postcheckDao.getPostcheckStandardByID(problem.getPostcheckStandardID());
	}	
	
	UserDao userDao = DaoCreator.createUserDao();
	User user = userDao.getUserByID(problem.getWriteUserID());
%>
<div class="hider" id="hider">
	<span>&nbsp;</span>
</div>

<div class="tt"></div>
<div class="content" style="height:480px;width:735px;overflow-y:scroll;overflow-x:hidden;">
	<table width="97%">
		<tr>
		<td>
		<%@include file="/problem_detail_section.jsp"%>
		<table align="center" border="1" width="99%" cellpadding="0"
			cellspacing="0">
			<%if(problem.getProblemType() == Constants.PROBLEM_TYPE_POSTCHECK) {%>
			<tr id="postcheckTR">
				<td class="td1">
				<span style="margin-left: 30px" class="span1">岗检：</span><%=Util.getDisplay(postcheck==null?null:postcheck.getCheckName(),"") %>
				<br/>
				<span style="margin-left: 30px" class="span1">检查方式：</span><%=Util.getDisplay(postcheckPattern==null?null:postcheckPattern.getPattern(), "") %>
				<br/>
				<span style="margin-left: 30px" class="span1">工作内容：</span><%=Util.getDisplay(postcheckContent==null?null:postcheckContent.getContent(), "") %>
				<br/>
				<span style="margin-left: 30px" class="span1">工作标准与要求：</span><%=Util.getDisplay(postcheckStandard==null?null:postcheckStandard.getStandard(), "") %>
				<br/>
				<span style="margin-left: 30px" class="span1">扣分值：</span>
				<%=problem.getGrade() == null ? "&nbsp;":Util.formatGrade(problem.getGrade()) %>
				<br/>
				<span style="margin-left: 30px" class="span1">要求整改完成日期：</span><%=Util.formatDate(problem.getCompleteDate()) %>
				</td>
			</tr>
			<%} %>
			<tr>
				<td class="td1">
					<span style="margin-left: 30px" class="span1">填报人及时间：</span>
					<span><%=user.getDepartment1Name()%>-<%=user.getDepartment2Name()%>-<%=user.getDepartment3Name()%></span>
					<span><%=user.getName()%></span>
					<span><%=Util.formatDateTime(problem.getWriteTime())%></span>
				</td>
			</tr>
		</table>
		</td>
		</tr>
	</table>
</div>
<script type="text/javascript">


</script>
<%
}
%>